<?php

namespace app\common\validate;

class Config extends \think\Validate
{
    protected $rule = [
        'name|配置类型名称'         =>  'require|unique:config',
        'key|标识'                  =>  'require|unique:config',
        'cate_id'                   =>  'require'
    ];

    protected $message = [
        'cate_id.require'       =>  '所属分类必须选择'
    ];
    
    public function sceneEdit(){
        return $this->remove([
            'name'  =>  'unique',
            'key'   =>  'unique',
        ]);
    }
}
